package com.weijing.pretty_app.activity

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.aisway.faceswap.utils.ActivityManager
import com.weijing.pretty_app.util.EdgeToEdgeHelper
import com.weijing.pretty_app.util.BrightnessManager

abstract class BaseActivity : AppCompatActivity() {

    abstract fun getMainView(): View

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // 设置边到边显示
        EdgeToEdgeHelper.setupEdgeToEdge(window)
        EdgeToEdgeHelper.adjustViewPadding(getMainView())

        ActivityManager.instance?.addActivity(this)
    }

    override fun onResume() {
        super.onResume()
        // 应用全局亮度
        BrightnessManager.applyToActivity(this)
    }
}